package org.jz.gae.redbook.spb.server.controller;


import org.jz.gae.redbook.spb.server.cache.SpeciesCashe;
import org.jz.gae.redbook.spb.shared.SpeciesEntityView;

import com.google.appengine.api.datastore.Entity;

public class SpeciesCasheGoogle extends AbstractCasheGoogle<SpeciesEntityView> implements SpeciesCashe
{
	private static SpeciesCashe instance;
	
	public synchronized static SpeciesCashe getInstance()
	{
		if (instance == null)
		{
			instance = new SpeciesCasheGoogle();
		}
		return instance;
	}
	
	@Override
	public synchronized SpeciesEntityView getEntityView(String _LocationKey)
	{
		return getEntityViewInternal(_LocationKey);
	}

	@Override
	protected SpeciesEntityView produceViewFormEntity(Entity _Entity)
	{
		SpeciesEntityView result = new SpeciesEntityView();
        SpeciesUtils.reflectEntityToView(_Entity, result);
		return result;
	}

}
